
/* --- FUNDO DOS BOTÕES --- */
/* Reduzimos o z-index para que ele fique "atrás" das camadas do chat */
.fundobotoes {
    position: fixed;
    bottom: 127px;
    right: 0px;
    z-index: 10; /* Valor baixo para ser a base */
}

/* --- ESTILOS GLOBAIS --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* --- BOTÃO DE ABRIR FLUTUANTE --- */
/* Aumentamos o z-index para garantir que ele seja a camada do topo */
.chat-open-wrapper {
    position: fixed;
    bottom: 110px;
    right: 10px;
    z-index: 9999; /* Valor muito alto para garantir que fique no topo de tudo */
    animation: pulse 1s infinite;
}

.open-chat-button-img {
    display: block; 
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    border: none;
    object-fit: cover;
    background-color: #0418cfff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.open-chat-button-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

/* --- CONTAINER PRINCIPAL DO CHAT --- */
/* Garantimos que a janela do chat também abra na frente do fundo */
           .chat-container {
            display: none;
            position: fixed;
            bottom: 90px;
            right: 70px;
            width: 300px; /* Pouco mais largo */
            height: 440px; /* Pouco mais alto */
            background-color: white;
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
            border-radius: 12px; /* Cantos mais arredondados */
            overflow: hidden;
            flex-direction: column;
            z-index: 9998;
        }


/* --- CABEÇALHO DO CHAT --- */
.chat-header {
    background : linear-gradient(90deg, rgb(0, 130, 130) 0%, rgb(0, 206, 0) 50%, rgb(0, 60, 255) 100%);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
}

.chat-header p {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.8;
}

.agent-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
    object-fit: cover;
}

.close-chat-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.4em;
    cursor: pointer;
    padding: 0 5px;
}

/* --- CORPO E MENSAGENS --- */
.chat-body {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #f0f2f5;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 0.95em;
}

.message p {
    margin: 0;
}

.agent-message {
    background-color: white;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

.user-message {
    background-color: #0418cfff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

/* --- BOTÃO DE WHATSAPP (TARJA VERDE) --- */
.whatsapp-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366; /* Verde Oficial */
    color: white !important;
    text-decoration: none !important;
    padding: 12px;
    border-radius: 10px;
    font-weight: bold;
    margin: 10px 0;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background 0.3s, transform 0.2s;
}

.whatsapp-link:hover {
    background-color: #128C7E;
    transform: scale(1.02);
}

/* --- ESTILOS PARA OS BOTÕES DE AÇÃO (Quick Replies) --- */
.quick-replies-container {
    display: flex;
    flex-direction: column;
    margin-top: 5px;
    gap: 8px;
}

.quick-reply-button {
    background-color: #e9ecef;
    color: #333;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    text-align: left;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
}

.quick-reply-button:hover {
    background-color: #dee2e6;
}

.quick-reply-button::after {
    content: "❯";
    margin-left: 10px;
    font-weight: bold;
    opacity: 0.6;
}

/* --- ENTRADA DE TEXTO --- */
.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
    background-color: white;
    align-items: center;
}

.chat-input input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    margin-right: 5px;
    font-size: 0.9em;
    outline: none;
}

.chat-input button {
    background-color: #0418cfff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s;
}

.chat-input button:hover {
    background-color: #1e637e;
}